﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using NUnit.Framework;

namespace Salient.SqlServer.Tests
{
    [TestFixture]
    public class DeadSimpleDtoFixture
    {
        [Test]
        public void IsScriptEmbedded()
        {
            using (Stream stream = typeof(DeadSimpleDto).Assembly.GetManifestResourceStream("Salient.SqlServer.DeadSimpleDTO2.sql"))
            {
                Assert.IsNotNull(stream);
                using (var reader = new StreamReader(stream))
                {
                    string sql = reader.ReadToEnd();
                    Assert.Greater(sql.Length, 0);
                }
            }
        }

        [Test]
        public void IsTemplateEmbedded()
        {
            using (Stream stream = typeof(DeadSimpleDto).Assembly.GetManifestResourceStream("Salient.SqlServer.DeadSimpleDTO2.ttinclude"))
            {
                Assert.IsNotNull(stream);
                using (var reader = new StreamReader(stream))
                {
                    string sql = reader.ReadToEnd();
                    Assert.Greater(sql.Length, 0);
                }
            }
        }
    }
}
